package com.PAT.practice02;

import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 *
 * @Author: zjz
 * @Date: 2022/02/16/0:11
 * @Description:
 * @Target:
 */
public class 输出PATest {

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        String ss1 = in.nextLine();

        // 记录P A T e s t
        // 对应0 1 2 3 4 5
        int[] counts = new int[6];

        for (int i = 0; i < ss1.length(); i++) {
            switch (ss1.charAt(i)){
                case 'P':counts[0]++;break;
                case 'A':counts[1]++;break;
                case 'T':counts[2]++;break;
                case 'e':counts[3]++;break;
                case 's':counts[4]++;break;
                case 't':counts[5]++;break;

            }
        }

     OutPrint(counts);

    }

    static void OutPrint(int[] ints){
        while (ints[0]+ints[1]+ints[2]+ints[3]+ints[4]+ints[5]!=0){

            for (int i = 0; i < ints.length; i++) {
                if (ints[i]!=0){
                    switch (i){
                        case 0:System.out.print("P");ints[i]--;break;
                        case 1:System.out.print("A");ints[i]--;break;
                        case 2:System.out.print("T");ints[i]--;break;
                        case 3:System.out.print("e");ints[i]--;break;
                        case 4:System.out.print("s");ints[i]--;break;
                        case 5:System.out.print("t");ints[i]--;break;
                    }

                }
            }
        }
    }

}
